<template>
  <el-container class="home-container">
    <el-aside style="width: 217px;">
      <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="2"
        text-color="#fff"
        router="true"
        style="width: 200px;"
      >
        <el-sub-menu v-for="firstMenu,idx of menuList" :key="firstMenu.authId" :index="idx">
          <template #title>
            <el-icon v-if="firstMenu.authName=='用户管理'">
              <svg t="1646894807342" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8966" width="200" height="200"><path d="M824.192 699.904a301.568 301.568 0 0 0-86.4-60.416 199.552 199.552 0 0 0 74.24-155.52 201.216 201.216 0 0 0-203.264-200 200.128 200.128 0 0 0-122.752 355.52c-31.744 14.72-60.928 34.88-86.4 60.416a298.048 298.048 0 0 0-87.616 203.904 8 8 0 0 0 8 8.192h56A7.936 7.936 0 0 0 384 904.32a226.048 226.048 0 0 1 66.688-153.536 226.624 226.624 0 0 1 161.28-66.752c60.928 0 118.208 23.68 161.28 66.752a226.944 226.944 0 0 1 66.752 153.536c0.128 4.288 3.712 7.68 8 7.68h56c4.48 0 8.128-3.712 8-8.192a297.408 297.408 0 0 0-87.808-203.904zM611.968 612.032a126.912 126.912 0 0 1-90.496-37.504 128.192 128.192 0 0 1 89.216-218.496 128.768 128.768 0 0 1 91.008 36.544c24.832 24.32 38.4 56.832 38.4 91.392 0 34.24-13.312 66.304-37.504 90.56a127.36 127.36 0 0 1-90.56 37.44zM361.536 510.336a256.384 256.384 0 0 1 2.944-72.96 8.064 8.064 0 0 0-4.48-8.768 127.552 127.552 0 0 1-75.584-120.512 127.36 127.36 0 0 1 36.224-85.568 127.36 127.36 0 0 1 93.248-38.72 127.872 127.872 0 0 1 106.368 58.88 8 8 0 0 0 9.28 3.2c17.6-6.144 36.224-10.432 55.296-12.48a8 8 0 0 0 6.336-11.52A200.32 200.32 0 0 0 415.36 112c-110.912-1.728-203.328 89.216-203.328 199.872 0 62.848 28.928 118.848 74.24 155.52-31.808 14.72-61.12 35.008-86.528 60.416a297.408 297.408 0 0 0-87.808 203.968 8 8 0 0 0 8 8.256h56.128a7.936 7.936 0 0 0 8-7.68 226.048 226.048 0 0 1 66.688-153.6 225.728 225.728 0 0 1 104.704-59.648 8 8 0 0 0 5.952-8.704z" p-id="8967"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='角色管理'">
              <svg t="1646893398140" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="200" height="200"><path d="M527.9 876c5-0.7 9.8-2.4 13.9-5.2 6.5-3.8 12.6-8.1 18.3-13 5.5-4.7 10.7-9.7 15.5-15 3.5-3 5.8-7 6.7-11.4 0.5-5.9 0.5-11.8 0-17.6 0-8.3-3.9-17.6-6.1-27-2.2-9.3-5-19.7-7.2-29.5s-4.4-17.6-6.1-23.3c4.4-4.1 8.3-8.6 11.6-13.5 3.8-4.6 6-10.2 6.1-16.1-0.2-4.9-1.9-9.6-5-13.5-3-4.5-6.8-8.5-11.1-11.9l-15-11.4h-43.8c-5.3 3.4-10.3 7.2-15 11.4-3.6 3.4-6.8 7.3-9.4 11.4-2.7 3.9-4.3 8.3-4.4 13 0.7 4.9 3.1 9.4 6.7 13 4.7 5.8 10.1 11 16.1 15.6l-7.2 21.3c-2.8 9.3-5.5 19.2-8.3 29.5-2.8 10.4-5 19.7-7.2 29-1.6 6.6-2.6 13.4-2.8 20.2 0.9 4.4 3.2 8.3 6.7 11.4 4.9 5.5 10.2 10.5 16.1 15 5.8 4.7 11.9 9 18.3 13 3.7 2.3 8.1 3.9 12.6 4.6z m399.3-81.9v15.6c1.2 12.3 0.3 24.8-2.8 36.8-1.3 9.3-4.5 18.3-9.4 26.4-7.2 6.2-16 10.5-25.5 12.4-117 29.5-237.7 43.8-358.8 42.5-124.3-0.2-248.4-11.3-370.5-33.2-16-2.3-31.5-6.9-46-13.5-6.7-4.7-11.6-18.1-14.4-40.4-2.9-21.1-1.6-42.6 3.9-63.2 2.3-18 11.8-34.5 26.6-46.1 15-10.9 31.9-19.3 49.9-24.9 19.4-6.2 108.1-34.7 128.7-39.4 19.6-4.1 38.4-11.3 55.5-21.3 10.5-5.7 20.2-12.7 28.8-20.7 11.8-10.5 18.5-25.2 18.3-40.4v-23.3c-0.3-11.5-5.3-22.4-13.9-30.6-7.8-7.3-16.6-14.5-27.2-22.3-5.2-4.5-9.3-10-12.2-16.1-6.5-5.5-10.3-13.1-10.5-21.3l-11.1-25.4c-4.4-1.2-8.5-3.1-12.2-5.7-4.3-3.4-8.2-7.2-11.6-11.4-4.8-5.8-8.5-12.3-11.1-19.2-2.8-8.2-3.8-16.8-2.8-25.4 0.3-7.3 1.8-14.4 4.4-21.3 2.4-6.4 6-12.4 10.5-17.6-0.5-21 0.8-41.9 3.9-62.7 2.6-19 6.9-37.7 12.8-56 6.1-18.5 15.2-36 27.2-51.8 10.3-14.6 23-27.5 37.7-38.4 12.8-9.2 26.8-16.9 41.6-22.8 13.9-5.3 28.4-9.1 43.3-11.4 13.7-2.2 27.7-3.4 41.6-3.6 16.1 0 32.1 1.9 47.7 5.7 15.6 3.6 30.9 8.7 45.5 15 12.7 5.6 24.8 12.4 36 20.2 9.5 6.5 18.1 14.2 25.5 22.8 14.6 17.4 25.9 37 33.3 58.1 7.1 19.4 12.3 39.3 15.5 59.6 3.5 21.8 5 43.8 4.4 65.8 4.2 2.3 7.5 5.7 9.4 9.8 2.7 4.7 4.5 9.8 5.5 15 1.3 7.4 1.3 14.9 0 22.3-1.2 9.5-4 18.8-8.3 27.5-3.2 6-7.5 11.5-12.8 16.1-4.8 4.1-10.5 7.1-16.6 8.8 0 8.8-5 17.6-7.8 25.4-2.8 7.8-6.7 14-10 20.7-3.2 6-7.5 11.5-12.8 16.1-4.7 3.9-9.7 7.6-15 10.9-4.4 2.7-8.5 5.9-12.2 9.3-3.7 3.4-6.7 7.5-8.9 11.9-2.6 5.5-4.5 11.2-5.5 17.1-1.1 8.4-1.1 17 0 25.4 0.7 8.8 3.1 17.4 7.2 25.4 4.9 9.4 11.9 17.7 20.5 24.4 11.4 8.8 24.4 15.8 38.3 20.7 15.7 5.8 31.8 10.7 48.2 14.5 17.2 4.1 87.6 32.1 103.7 37.8 15.4 5.4 29.9 12.7 43.3 21.8 12.2 9.2 21.4 21.4 26.6 35.2 2.9 10.8 4.4 21.6 4.6 32.4z" fill="" p-id="4552"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='权限管理'">
              <svg t="1646893506242" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5392" width="200" height="200"><path d="M101.888 985.088l-20.48-130.56 270.336-371.712a278.2208 278.2208 0 0 1 16.896-304.128 279.3472 279.3472 0 0 1 183.808-112.64c74.24-11.776 148.48 6.144 209.408 50.176s100.864 109.568 112.64 183.808c11.776 74.24-6.144 148.48-50.176 209.408a279.3472 279.3472 0 0 1-183.808 112.64c-43.52 6.656-88.064 3.584-130.048-9.728l-15.36 20.992 1.024 94.208-98.816 39.936-151.552 208.896-143.872 8.704z m33.28-117.248l10.24 63.488 73.728-4.608 146.432-201.216 79.872-32.256-1.024-76.288 48.128-66.56 18.432 7.68c38.4 15.36 80.384 19.968 121.856 13.824 60.928-9.728 114.176-42.496 150.528-92.16 36.352-49.664 50.688-110.592 40.96-171.52-9.728-60.928-42.496-114.176-92.16-150.528s-110.592-50.688-171.52-40.96c-60.928 9.216-114.688 41.984-150.528 92.16-36.352 49.664-51.2 110.592-41.472 171.008 5.12 32.256 16.896 62.976 34.816 90.112l9.728 14.848-278.016 382.976z" p-id="5393"></path><path d="M685.568 372.736c-5.12 0-10.752-1.536-14.848-5.12l-136.704-99.328a25.8048 25.8048 0 0 1-9.728-28.16c12.288-42.496 48.64-74.24 92.672-81.408 30.72-4.608 60.928 2.56 85.504 20.48 25.088 17.92 41.472 45.056 46.08 75.264 6.656 43.52-12.288 88.064-48.64 113.152a21.504 21.504 0 0 1-14.336 5.12z m-104.96-133.632l103.424 75.264a64.0512 64.0512 0 0 0-11.264-93.184c-13.824-10.24-30.72-13.824-47.616-11.264-18.432 3.072-34.816 13.824-44.544 29.184z" p-id="5394"></path><path d="M851.968 972.8h-226.816c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h226.816c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6z" p-id="5395"></path><path d="M763.392 870.4h-134.144c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h134.144c14.336 0 25.6 11.264 25.6 25.6s-11.776 25.6-25.6 25.6z" p-id="5396"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='商品管理'">
              <svg t="1646893610713" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6226" width="200" height="200"><path d="M691.2 870.4H307.2c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h384c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6z" p-id="6227"></path><path d="M874.496 998.4H149.504c-42.496 0-76.8-34.304-76.8-76.8l0.512-7.168 58.368-614.4c3.584-39.936 36.352-69.632 76.288-69.632h608.256c39.936 0 72.704 29.696 76.288 69.632l58.368 614.4c2.048 20.48-4.096 40.448-17.408 56.32-12.8 15.872-31.744 25.6-52.224 27.648h-6.656zM207.872 281.6a25.6 25.6 0 0 0-25.6 23.04l-58.368 614.4c0 16.384 11.264 28.16 25.6 28.16h724.48c9.216-1.024 15.36-4.096 19.968-9.216s6.144-11.776 5.632-18.432l-58.368-614.4a25.2416 25.2416 0 0 0-25.6-23.04H207.872z" p-id="6228"></path><path d="M716.8 384c-14.336 0-25.6-11.264-25.6-25.6V256c0-98.816-80.384-179.2-179.2-179.2S332.8 157.184 332.8 256v102.4c0 14.336-11.264 25.6-25.6 25.6s-25.6-11.264-25.6-25.6V256C281.6 129.024 385.024 25.6 512 25.6s230.4 103.424 230.4 230.4v102.4c0 14.336-11.264 25.6-25.6 25.6z" p-id="6229"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='盘点管理'">
              <svg t="1646893792115" class="icon" viewBox="0 0 1147 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7160" width="200" height="200"><path d="M799.721813 0.000044H113.779a113.64648 113.64648 0 0 0-113.74587 113.74587v685.975943a113.635437 113.635437 0 0 0 113.74587 113.74587h685.942813a113.635437 113.635437 0 0 0 113.74587-113.74587v-684.242147C913.467683 51.70472 863.496803 0.000044 799.721813 0.000044z m48.25917 749.73989a98.185877 98.185877 0 0 1-98.285267 98.285266h-585.95688a98.19692 98.19692 0 0 1-98.285266-98.285266V163.738881a98.19692 98.19692 0 0 1 98.285266-98.285267h586.001054a98.19692 98.19692 0 0 1 98.285266 98.285267z m0 0" p-id="7161"></path><path d="M791.108048 210.275298c0 24.118542-22.406832 43.068825-51.704676 43.068824h-570.496277c-27.608221 0-51.704676-18.961326-51.704676-43.068824v-43.068825c0-24.129585 22.406832-43.068825 51.704676-43.068824h570.496277c27.608221 0 51.704676 18.961326 51.704676 43.068824z m0 0M270.593695 444.669093h-55.150183a34.576536 34.576536 0 0 1-34.466102-34.466103v-55.150182a34.576536 34.576536 0 0 1 34.466102-34.477146h55.150183a34.576536 34.576536 0 0 1 34.466102 34.477146v55.150182a34.576536 34.576536 0 0 1-34.466102 34.466103z m0 0M479.146195 444.669093h-55.150182a34.576536 34.576536 0 0 1-34.477146-34.466103v-55.150182a34.576536 34.576536 0 0 1 34.477146-34.477146h55.150182a34.576536 34.576536 0 0 1 34.477146 34.477146v55.150182a34.576536 34.576536 0 0 1-34.477146 34.466103z m0 0M687.687652 444.669093h-55.139138a34.576536 34.576536 0 0 1-34.477147-34.466103v-55.150182a34.576536 34.576536 0 0 1 34.477147-34.477146h55.139138a34.576536 34.576536 0 0 1 34.477147 34.477146v55.150182a34.576536 34.576536 0 0 1-34.477147 34.466103z m0 0M270.593695 618.744447h-55.150183a34.565493 34.565493 0 0 1-34.466102-34.455059v-55.161226a34.576536 34.576536 0 0 1 34.466102-34.477146h55.150183a34.576536 34.576536 0 0 1 34.466102 34.477146v55.161226a34.565493 34.565493 0 0 1-34.466102 34.455059z m0 0M479.146195 618.744447h-55.150182a34.565493 34.565493 0 0 1-34.477146-34.455059v-55.161226a34.576536 34.576536 0 0 1 34.477146-34.477146h55.150182a34.576536 34.576536 0 0 1 34.477146 34.477146v55.161226a34.565493 34.565493 0 0 1-34.477146 34.466103z m0 0M687.687652 618.744447h-55.139138a34.565493 34.565493 0 0 1-34.477147-34.455059v-55.161226a34.576536 34.576536 0 0 1 34.477147-34.477146h55.139138a34.576536 34.576536 0 0 1 34.477147 34.477146v55.161226a34.565493 34.565493 0 0 1-34.477147 34.466103z m0 0M270.593695 784.172907h-55.150183a34.576536 34.576536 0 0 1-34.466102-34.466103v-55.216442a34.576536 34.576536 0 0 1 34.466102-34.466103h55.150183a34.576536 34.576536 0 0 1 34.466102 34.466103v55.216442a34.576536 34.576536 0 0 1-34.466102 34.466103z m0 0M479.146195 784.172907h-55.150182a34.576536 34.576536 0 0 1-34.477146-34.466103v-55.216442a34.576536 34.576536 0 0 1 34.477146-34.466103h55.150182a34.576536 34.576536 0 0 1 34.477146 34.466103v55.216442a34.576536 34.576536 0 0 1-34.477146 34.466103z m0 0M687.687652 784.172907h-55.139138a34.576536 34.576536 0 0 1-34.477147-34.466103v-55.216442a34.576536 34.576536 0 0 1 34.477147-34.466103h55.139138a34.576536 34.576536 0 0 1 34.477147 34.466103v55.216442a34.576536 34.576536 0 0 1-34.477147 34.466103z m0 0" p-id="7162"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='采购管理'">
              <svg t="1646893836313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7968" width="200" height="200"><path d="M320.22 879.87m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" p-id="7969"></path><path d="M737.23 879.87m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" p-id="7970"></path><path d="M917.93 195.85H198.37a32.22 32.22 0 0 0-4.48 0.32l-10.69-60.64q-0.08-0.44-0.17-0.88c-3.16-15.39-11.91-28.34-25.3-37.48-15.25-10.4-35.55-15.32-61.92-15a32 32 0 0 0 0.33 64h0.34c14.89-0.16 21.75 2.21 24.19 3.38L225.35 743.6A44.06 44.06 0 0 0 269.2 784H800a32 32 0 0 0 0-64H286.17l-7.9-44.83h543.32c21.19 0 38.75-15 41.54-34.39L959 243.13a32 32 0 0 0 0.89-7.5c-0.04-21.94-18.89-39.78-41.96-39.78z m-113.5 415.28H269.06c-0.69 0-1.37 0-2.05 0.07L205.1 259.85h684z" p-id="7971"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='入库管理'">
              <svg t="1646894080311" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1269" width="200" height="200"><path d="M469.051 81.458c25.147-19.074 59.827-19.239 85.136-0.509l0.764 0.573 391.538 297.91c11.867 9.03 14.168 25.97 5.139 37.837-8.94 11.748-25.632 14.12-37.48 5.406l-0.357-0.268-391.539-297.91a17 17 0 0 0-20.256-0.246l-0.311 0.23-392.814 297.95c-11.88 9.012-28.817 6.686-37.829-5.195-8.921-11.761-6.73-28.478 4.842-37.556l0.353-0.272 392.814-297.95z" p-id="1270"></path><path d="M179 319c14.763 0 26.758 11.848 26.996 26.554L206 346v498.877c0 33.352 26.767 60.453 59.991 60.992l1.009 0.008h207.758c14.911 0 27 12.088 27 27 0 14.762-11.848 26.758-26.554 27H267c-62.878 0-113.97-50.463-114.985-113.099l-0.015-1.901V346c0-14.912 12.088-27 27-27z m666.047 0c14.763 0 26.758 11.848 26.996 26.554l0.004 0.446v190.635c0 14.912-12.088 27-27 27-14.763 0-26.758-11.848-26.996-26.554l-0.004-0.446V346c0-14.912 12.088-27 27-27z" p-id="1271"></path><path d="M697.188 960a36.611 36.611 0 0 0 16.406-3.87 36.638 36.638 0 0 0 20.281-32.773V813.43h183.438c20.258 0 36.687-16.41 36.687-36.643V630.214c0-20.233-16.43-36.642-36.687-36.642H733.875V483.643a36.638 36.638 0 0 0-20.28-32.774 36.725 36.725 0 0 0-38.42 3.46l-293.5 219.857a36.619 36.619 0 0 0 0 58.628l293.5 219.857A36.734 36.734 0 0 0 697.188 960zM908 754.017H730.232c-23.533 0-42.618 18.439-42.618 41.175V900L425 703.788 687.614 513v100.515c0 22.736 19.085 41.175 42.618 41.175H908v99.327z" p-id="1272"></path><path d="M309 613c11.046 0 20 8.954 20 20v51c0 11.046-8.954 20-20 20h-51c-11.046 0-20-8.954-20-20v-51c0-11.046 8.954-20 20-20h51z m0-135c11.046 0 20 8.954 20 20v52c0 11.046-8.954 20-20 20h-51c-11.046 0-20-8.954-20-20v-52c0-11.046 8.954-20 20-20h51z m143 0c11.046 0 20 8.954 20 20v52c0 11.046-8.954 20-20 20h-52c-11.046 0-20-8.954-20-20v-52c0-11.046 8.954-20 20-20h52zM309 339c11.046 0 20 8.954 20 20v51c0 11.046-8.954 20-20 20h-51c-11.046 0-20-8.954-20-20v-51c0-11.046 8.954-20 20-20h51z m143 0c11.046 0 20 8.954 20 20v51c0 11.046-8.954 20-20 20h-52c-11.046 0-20-8.954-20-20v-51c0-11.046 8.954-20 20-20h52z m142 0c11.046 0 20 8.954 20 20v51c0 11.046-8.954 20-20 20h-51c-11.046 0-20-8.954-20-20v-51c0-11.046 8.954-20 20-20h51z" p-id="1273"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='出库管理'">
              <svg t="1646894171959" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3677" width="200" height="200"><path d="M469.051 81.458c25.147-19.074 59.827-19.239 85.136-0.509l0.764 0.573 391.538 297.91c11.867 9.03 14.168 25.97 5.139 37.837-8.94 11.748-25.632 14.12-37.48 5.406l-0.357-0.268-391.539-297.91a17 17 0 0 0-20.256-0.246l-0.311 0.23-392.814 297.95c-11.88 9.012-28.817 6.686-37.829-5.195-8.921-11.761-6.73-28.478 4.842-37.556l0.353-0.272 392.814-297.95z" p-id="3678"></path><path d="M179 319c14.763 0 26.758 11.848 26.996 26.554L206 346v498.877c0 33.352 26.767 60.453 59.991 60.992l1.009 0.008h207.758c14.911 0 27 12.088 27 27 0 14.762-11.848 26.758-26.554 27H267c-62.878 0-113.97-50.463-114.985-113.099l-0.015-1.901V346c0-14.912 12.088-27 27-27z m666.047 0c14.763 0 26.758 11.848 26.996 26.554l0.004 0.446v190.635c0 14.912-12.088 27-27 27-14.763 0-26.758-11.848-26.996-26.554l-0.004-0.446V346c0-14.912 12.088-27 27-27z" p-id="3679"></path><path d="M623.813 960a36.611 36.611 0 0 1-16.407-3.87 36.638 36.638 0 0 1-20.281-32.773V813.43H403.687c-20.258 0-36.687-16.41-36.687-36.643V630.214c0-20.233 16.43-36.642 36.687-36.642h183.438V483.643a36.638 36.638 0 0 1 20.28-32.774 36.725 36.725 0 0 1 38.42 3.46l293.5 219.857a36.619 36.619 0 0 1 0 58.628l-293.5 219.857A36.734 36.734 0 0 1 623.812 960zM419 754.017h177.768c23.533 0 42.618 18.439 42.618 41.175V900L902 703.788 639.386 513v100.515c0 22.736-19.085 41.175-42.618 41.175H419v99.327z" p-id="3680"></path><path d="M309 613c11.046 0 20 8.954 20 20v51c0 11.046-8.954 20-20 20h-51c-11.046 0-20-8.954-20-20v-51c0-11.046 8.954-20 20-20h51z m0-135c11.046 0 20 8.954 20 20v52c0 11.046-8.954 20-20 20h-51c-11.046 0-20-8.954-20-20v-52c0-11.046 8.954-20 20-20h51z m143 0c11.046 0 20 8.954 20 20v52c0 11.046-8.954 20-20 20h-52c-11.046 0-20-8.954-20-20v-52c0-11.046 8.954-20 20-20h52zM309 339c11.046 0 20 8.954 20 20v51c0 11.046-8.954 20-20 20h-51c-11.046 0-20-8.954-20-20v-51c0-11.046 8.954-20 20-20h51z m143 0c11.046 0 20 8.954 20 20v51c0 11.046-8.954 20-20 20h-52c-11.046 0-20-8.954-20-20v-51c0-11.046 8.954-20 20-20h52z m142 0c11.046 0 20 8.954 20 20v51c0 11.046-8.954 20-20 20h-51c-11.046 0-20-8.954-20-20v-51c0-11.046 8.954-20 20-20h51z" p-id="3681"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='统计查询'">
              <svg t="1646894228138" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4506" width="200" height="200"><path d="M690.2688 114.74346667L801.376 225.85066667 581.11466667 446.01813333 399.55946667 310.20586667c-0.49813333-0.4032-1.1808-0.52693333-1.70666667-0.80853334-1.89333333-1.27253333-3.97653333-2.0768-6.1152-2.94933333-1.89226667-0.64853333-3.53813333-1.48906667-5.49333333-1.88906667-2.112-0.3744-4.128-0.30933333-6.3008-0.21866666-2.07893333-0.09173333-4.03306667-0.1856-6.144 0.18666666-1.89333333 0.3712-3.66293333 1.2736-5.46453334 1.95733334-2.16853333 0.80533333-4.25173333 1.6416-6.29866666 2.97813333-0.528 0.34133333-1.1168 0.30933333-1.54986667 0.7136l-283.264 211.04c-14.46293333 10.8-17.50613333 31.19253333-6.64426667 45.68533333a32.55573333 32.55573333 0 0 0 27.872 13.09653334c6.23893333-0.2784 12.41386667-2.4512 17.81333334-6.36053334L379.8848 377.12l184.6912 138.16853333c1.70666667 1.36746667 3.6608 1.9872 5.58613333 2.85653334 1.21173333 0.49706667 2.32746667 1.3024 3.59893334 1.70666666a31.05813333 31.05813333 0 0 0 12.13866666 1.89226667h0.02986667c4.25066667-0.24853333 8.43946667-1.42613333 12.35093333-3.38133333 1.33333333-0.592 2.42133333-1.6768 3.62986667-2.48213334 1.7696-1.1808 3.75573333-2.0512 5.33866667-3.66293333l240.30933333-240.1856 112.38293333 112.3808V114.74346667H690.2688zM133.64266667 877.4752c0 17.56693333 14.21333333 31.78133333 31.7856 31.78133333h31.776c17.56586667 0 31.78133333-14.2144 31.78133333-31.78133333V653.616l-95.34293333 71.06986667v152.78933333zM607.93386667 675.4016c-1.1808 0.8064-2.26666667 1.89226667-3.60213334 2.48213333-3.94133333 1.95733333-8.1312 3.168-12.3808 3.3856l-0.032 0.02986667a31.68106667 31.68106667 0 0 1-12.1344-1.92426667c-0.43733333-0.12693333-0.80746667-0.3744-1.21173333-0.59093333v198.69013333c0 17.56693333 14.21226667 31.78133333 31.78133333 31.78133334h31.77706667c17.56906667 0 31.78346667-14.2144 31.78346667-31.78133334v-266.34666666l-60.6464 60.61333333c-1.58186667 1.61386667-3.536 2.51306667-5.3344 3.6608z" p-id="4507"></path><path d="M801.03573333 877.4752c0 17.56693333 14.2144 31.78133333 31.7824 31.78133333h31.77813334c17.568 0 31.78133333-14.2144 31.78133333-31.78133333V388.7872l-95.34293333 95.30986667v393.37813333zM356.1088 558.864v318.61226667c0 17.56693333 14.21226667 31.78133333 31.78133333 31.78133333h31.77813334c17.568 0 31.78026667-14.2144 31.78026666-31.78133333v-291.79733334l-65.51466666-49.0368-29.82506667 22.22186667z" p-id="4508"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='站内通知'">
              <svg t="1646894373899" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4775" width="200" height="200"><path d="M852 699.1c-24.8-17.2-40.6-44.9-40.6-76.8V436.2c0-136-100.2-249.6-234.3-277.7v-6.7c0-34.8-28.6-62.5-63.9-62.5s-63.9 28.2-63.9 62.5v6.7C315.2 186.6 215 299.7 215 436.2v185.6c0 30.1-13.8 56.3-35.8 73.5-2.4 1.9-3.8 2.9-10.5 7.6-10.5 7.6-17.2 19.6-17.2 33.9 0 22.9 19.1 42 42.5 42h639c23.4 0 42.5-18.6 42.5-42 0-14.8-7.6-27.7-19.6-35.3-2-0.9-2.5-1.9-3.9-2.4zM513.2 925.3c58.7 0 106.4-46.8 106.4-104.5H406.8c0 57.3 47.7 104.5 106.4 104.5z" p-id="4776"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='调货管理'">
              <svg t="1646894462652" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5110" width="200" height="200"><path d="M731.428571 658.285714a146.285714 146.285714 0 1 0 146.285715 146.285715 146.285714 146.285714 0 0 0-146.285715-146.285715z m0 219.428572a73.142857 73.142857 0 1 1 73.142858-73.142857 73.142857 73.142857 0 0 1-73.142858 73.142857zM256 731.428571A109.714286 109.714286 0 1 0 365.714286 841.142857 109.714286 109.714286 0 0 0 256 731.428571z m36.571429 146.285715H219.428571v-73.142857h73.142858z" p-id="5111"></path><path d="M365.714286 73.142857v73.142857H219.428571L0 438.857143v438.857143h219.428571v-73.142857H73.142857V585.142857h292.571429v219.428572H292.571429v73.142857h365.714285v-73.142857H438.857143V146.285714h512v658.285715h-146.285714v73.142857h219.428571V73.142857z m0 438.857143H73.142857V438.857143l146.285714-219.428572h146.285715z" p-id="5112"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='仓库管理'">
              <svg t="1646894528224" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5942" width="200" height="200"><path d="M948.57 424.58L532.7 71.75a32 32 0 0 0-41.4 0L75.43 424.58a32 32 0 0 0 41.4 48.8L127.9 464v454a41.91 41.91 0 0 0 41.86 41.86h684.53A41.91 41.91 0 0 0 896.15 918V464l11 9.34a32 32 0 0 0 41.4-48.8z m-116.42-14.37v485.64H191.9V410.21v-0.5L512 138.12l320.16 271.63c0 0.15-0.01 0.3-0.01 0.46z" p-id="5943"></path><path d="M255.85 735.78m12 0l72 0q12 0 12 12l0 72q0 12-12 12l-72 0q-12 0-12-12l0-72q0-12 12-12Z" p-id="5944"></path><path d="M447.89 735.78m12 0l72 0q12 0 12 12l0 72q0 12-12 12l-72 0q-12 0-12-12l0-72q0-12 12-12Z" p-id="5945"></path><path d="M255.85 607.94m12 0l72 0q12 0 12 12l0 72q0 12-12 12l-72 0q-12 0-12-12l0-72q0-12 12-12Z" p-id="5946"></path><path d="M255.85 480.46m12 0l72 0q12 0 12 12l0 72q0 12-12 12l-72 0q-12 0-12-12l0-72q0-12 12-12Z" p-id="5947"></path><path d="M447.89 607.94m12 0l72 0q12 0 12 12l0 72q0 12-12 12l-72 0q-12 0-12-12l0-72q0-12 12-12Z" p-id="5948"></path><path d="M639.92 735.78m12 0l72 0q12 0 12 12l0 72q0 12-12 12l-72 0q-12 0-12-12l0-72q0-12 12-12Z" p-id="5949"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='供货商管理'">
              <svg t="1646894618011" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6497" width="200" height="200"><path d="M951.584 223.2v-152.96c0-21.152-17.088-38.24-38.208-38.24H106.016c-21.12 0-38.176 17.088-38.176 38.208v152.992A38.176 38.176 0 0 0 32 261.28v157.312c0 29.12 5.76 57.44 17.184 84.064 5.12 12.16 11.488 23.68 18.656 34.528v412c0 21.024 17.056 38.24 38.208 38.24h807.328c21.12 0 38.208-17.088 38.208-38.24V537.184a213.472 213.472 0 0 0 35.84-118.592V261.312c0-20.32-15.904-36.928-35.84-38.08zM153.824 117.984H865.6v105.088H153.824V117.984z m432.32 783.552H433.28v-124.32h152.864v124.32z m279.456 0h-203.04v-162.56c0-21.12-17.056-38.176-38.208-38.176h-229.28c-21.152 0-38.24 17.056-38.24 38.208v162.56H153.824v-289.28a215.264 215.264 0 0 0 94.816 21.632 215.68 215.68 0 0 0 84.064-16.864c16.48-6.912 32-15.744 46.24-26.368a0.768 0.768 0 0 1 0.704 0c14.208 10.624 29.632 19.456 46.208 26.368 26.656 11.232 54.944 16.864 84.096 16.864a215.68 215.68 0 0 0 84.064-16.864c16.48-6.912 32-15.744 46.24-26.368a0.768 0.768 0 0 1 0.704 0c14.208 10.624 29.6 19.456 46.208 26.368 26.624 11.232 54.944 16.864 84.096 16.864a215.68 215.68 0 0 0 84.064-16.864c3.584-1.536 7.168-3.104 10.752-4.768v289.28h-0.48z m35.84-482.944c0 71.424-58.56 129.344-130.56 129.344a130.784 130.784 0 0 1-113.696-65.6 19.104 19.104 0 0 0-16.576-9.664h-0.736a19.264 19.264 0 0 0-16.576 9.696 130.464 130.464 0 0 1-113.6 65.568 130.56 130.56 0 0 1-113.44-65.344 19.712 19.712 0 0 0-34.144 0 130.944 130.944 0 0 1-113.6 65.344c-72 0-130.528-57.92-130.528-129.344V309.664c0-0.352 0.256-0.608 0.608-0.608H900.8c0.352 0 0.608 0.256 0.608 0.64v108.896z" p-id="6498"></path></svg>
            </el-icon>
            <el-icon v-if="firstMenu.authName=='产地管理'">
              <location />
            </el-icon>
            <span>{{firstMenu.authName}}</span>
          </template>
          <el-menu-item 
            v-for="secondMenu of firstMenu.childAuth" 
            :key="secondMenu.authId" 
            :index="secondMenu.authUrl"
            >
            {{secondMenu.authName}}
          </el-menu-item>
        </el-sub-menu>
      </el-menu>
    </el-aside>
    <el-container class="main-container">
      <el-header>
        <div class="header_left">
          <img src="/warehouse.png" width="40" height="40" />
          <span style="font-weight: bold;">&nbsp;恒合仓库管理系统</span>
        </div>
        <div class="header_right">
          <span>当前用户：{{`${currUser.userCode}【${currUser.userName}】`}}</span>
          <a href="#" @click.prevent="logout">退出</a>
        </div>
      </el-header>
      <el-main>
        <div class="breadcrumb">
          <el-icon><fold /></el-icon>
          <el-breadcrumb style="display: inline-block;margin-left: 10px;">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <template v-if="$route.meta && $route.meta.nav">
              <el-breadcrumb-item v-for="path in $route.meta.nav " :key="path">{{path}}</el-breadcrumb-item>
            </template>
          </el-breadcrumb>
        </div>
        <router-view></router-view>
      </el-main>
      <el-footer>版权所有&nbsp;&copy;2000-2022&nbsp; 恒合智能仓储科技有限公司</el-footer>
    </el-container>
  </el-container>
</template>

<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
import { tip, get, del, removeLocalToken, ddo } from "@/common";
import { Location, Fold } from '@element-plus/icons-vue'

const router = useRouter(); // 获取路由器

// 当前路径
/* const paths = ref([]);
const selectMenu = (first, second) => {
  paths.value = [first, second];
} */

// 获取当前登录用户
const currUser = ref({});
const getCurrentUser = () => {
  get("/curr-user").then(result => {
    currUser.value = result.data;
  });
}
getCurrentUser();

// 退出
const logout = () => {
  del("/logout").then(result =>{
    // 删除本地token
    removeLocalToken();
    // 替换路由
    router.replace("/login");
    tip.success("您已退出系统！");
  });
}

// 获取所有权限
const menuList = ref([]);
const getMenuList = () => {
  get("/user/auth-list").then(result => {
    menuList.value = result.data;
  });
}
getMenuList();

</script>

<style scoped>
.home-container{
  height: 100%;
  display: flex;
}
.main-container{
  display: flex;
  flex-direction: column;
}
.el-header{
  line-height: 60px;

  display: flex;
  justify-content: space-between;
}
.el-header .header_left{
  font-size: 22px;
  font-family: 微软雅黑;
}
.header_left img{
  margin-top: -5px;
  vertical-align: middle;
}
.el-header .header_right{
  padding-right: 20px;
}
.header_right a{
  margin-left: 10px;
}

.el-menu{
  height: 100%;
}
.el-main {
  border-top: 1px solid #CCC;
  border-bottom: 1px solid #CCC;
}
.breadcrumb{
  margin-bottom: 20px;
}
.el-footer {
  text-align: center;
  font-size: 12px;
  height: 40px;
  line-height: 40px;
}
</style>